import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import path from 'path'

export default defineConfig({
  plugins: [vue()],
  base: process.env.NODE_ENV === 'production' ? './' : '/',
  resolve: {
    alias: {
      '@': path.resolve(__dirname, 'src/renderer'),
      '@stores': path.resolve(__dirname, 'src/renderer/stores'),
      '@utils': path.resolve(__dirname, 'src/utils'),
      '@services': path.resolve(__dirname, 'src/services'),
      '@constants': path.resolve(__dirname, 'src/constants'),
      '@composables': path.resolve(__dirname, 'src/composables')
    }
  },
  build: {
    outDir: 'dist',
    assetsDir: '.',
    rollupOptions: {
      external: ['electron', 'path', '@electron/remote'],
      output: {
        format: 'cjs'
      }
    },
    sourcemap: false,
    minify: true,
    emptyOutDir: true
  },
  server: {
    port: 5173
  }
}) 